package com.beibei.framework.bean;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.apache.commons.lang.builder.ReflectionToStringBuilder;

/**
 * 实体类基类
 * 
 * @author 309814490@qq.com
 * @since 2014-02-12
 */
public class BaseBean implements Serializable {
	private static final long serialVersionUID = 5013360913645274070L;

	/**
	 * 重写基类的toString方法，输出对象的所有字段的信息
	 */
	public String toString() {
		return ReflectionToStringBuilder.toString(this);
	}

	public String trim(String value) {
		return (value == null) ? "" : value;
	}

	private String DEFAULT = "yyyy-MM-dd HH:mm:ss";

	/**
	 * 获取系统当前时间串,格式yyyy-MM-dd HH:mm:ss
	 */
	public String getCurrentTime() {
		return new SimpleDateFormat(DEFAULT).format(new Date());
	}
}
